/**
 * Created by linxin on 2017/3/11.
 */
import {save} from '../../utils';
// import $srv from '../../server';

export default {
  SET_AUTHOR_ID(states,id) {
    states.authorId = id;
  },
  SET_USER(states, user) {
    user.avatar = user.avatar || "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif"
    states.info = { ...user };
  },
  SET_ROLES(states, roles) {
    states.info.roles = roles;
    states.info = { ...states.info };
  },
  CLEAR_ACCOUNT(states) {
    states.info = {};
    save("token");
  },
}
